import 'description.dart';
import 'event_unit_entry.dart';

class Athlete {
  String? code;
  String? order;
  Description? description;
  EventUnitEntry? eventUnitEntry;

  Athlete({this.code, this.order, this.description, this.eventUnitEntry});

  factory Athlete.fromJson(Map<String, dynamic> json) => Athlete(
        code: json['Code'] as String?,
        order: json['Order'] as String?,
        description: json['Description'] == null
            ? null
            : Description.fromJson(json['Description'] as Map<String, dynamic>),
        eventUnitEntry: json['EventUnitEntry'] == null
            ? null
            : EventUnitEntry.fromJson(
                json['EventUnitEntry'] as Map<String, dynamic>),
      );

  Map<String, dynamic> toJson() => {
        'Code': code,
        'Order': order,
        'Description': description?.toJson(),
        'EventUnitEntry': eventUnitEntry?.toJson(),
      };
}
